<?php
include_once "conn.php";
$echarts=[]; //图表数据
$date=[6,5,4,3,2,1,0]; //标记是哪一天，0表示今天，1表示昨天，以此类推
foreach ($date as $value) {
  $sql = $db -> query("SELECT SUM(goods_price * order_num) AS money  FROM 
  order_goods JOIN order_user ON order_user.order_user_id = order_goods.order_user_id 
	      JOIN goods ON goods.`goods_id` = order_goods.`goods_id`
  WHERE TO_DAYS(NOW()) - $value = TO_DAYS(order_time)");
  $row = $sql -> fetch_assoc()['money'];
  array_push($echarts,$row);
}
echo json_encode($echarts);
$db->close();
?>